package com.teach;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-13 11:33
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class Demo05 {
  public static void main(String[] args) {
    System.out.println(String.format("%s",""));
//    System.out.println(StringBuffer.???);

    byte[] bs = "asdf".getBytes();
    StringBuilder sb = new StringBuilder("|asdf|");
//    sb.getBytes();???
    //- format
    //- getBytes
    //- replaceAll
    //- replaceFirst
    //- split

    //都有方法
    String str1 = "abc";
    str1.charAt(1);
    sb.charAt(1);
    str1.indexOf("b");
    sb.indexOf("b");
    str1.lastIndexOf("b");
    sb.lastIndexOf("b");
    String str2 = str1.substring(0,1);
    String str3 = sb.substring(0,1);

    //特有的方法
    System.out.println(sb);
    sb.append(1);
    sb.append('a');
    sb.append("abc");
    sb.append(false);
    System.out.println(sb);
    sb.insert(0,1);
    sb.insert(0,2);
    sb.insert(0,true);
    sb.insert(5,"A");
    System.out.println(sb);
    sb.setCharAt(1,'R');
    System.out.println(sb);
    sb.deleteCharAt(1);
    System.out.println(sb);
    sb.delete(1,3);
    System.out.println(sb);
    StringBuilder sb1 = sb.reverse();
    System.out.println(sb);
    System.out.println(sb1);
    System.out.println(sb==sb1);
    String hw = "上海自来水来自海上1";
    System.out.println(hw.equals(new StringBuilder(hw).reverse().toString()));

  }
}
